<?php
abstract class Component{
    protected $name;

    public function __construct($name)
    {
        $this->name = $name;
    }

    abstract public function add();
    abstract public function remove();
    abstract public function display();
}

class Leaf extends Component{
    public function add(){
        echo '不能添加';
    }

    public function remove(){
        echo '不能删除';
    }

    public function display(){
        echo '';
    }
}

class Composite extends Component{
    public function add(){
        echo '不能添加';
    }

    public function remove(){
        echo '不能删除';
    }

    public function display(){
        echo '';
    }
}